package com.straw.hat.common.util;

import java.io.Serializable;
import java.util.Random;

/**
 * @company: 鲸灵科技
 * @author: qiyue@webuy.ai
 * @date: 2019/10/10
 * @time: 1:43 下午
 */
public class RandomNumGenerator  {

    private static final Random random = new Random();

    public static int [] generator(int len){
        int [] numbers = new int [len];
        for (int i = 0; i < len; i++) {
            int num = random.nextInt(len) + 1;
            numbers[i] = num;
        }
        return numbers;
    }

    public static final int generator(Integer lower,Integer upper){
        return (int) (Math.random() * (upper - lower) + lower);
    }
}
